package rou.configuration;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ProtocolConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.config.spring.ServiceBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import service.ExposeBomService;

/**
 * Created by ervin on 2017/8/2.
 */
@Configuration
public class DubboServiceConfiguration {

    @Autowired
    ApplicationConfig applicationConfig;

    @Autowired
    @Qualifier("dubboProtocolConfig")
    ProtocolConfig dubboProtocolConfig;

    @Autowired
    RegistryConfig registryConfig;

    /*@Bean
    public ServiceBean<ExposeBomService> exposeBomServiceConfig(ExposeBomService exposeBomService ){
        ServiceBean<ExposeBomService> serviceBean = new ServiceBean<ExposeBomService>();
        serviceBean.setInterface( ExposeBomService.class.getName() );
        serviceBean.setRef( exposeBomService );
        serviceBean.setVersion( "1.0" );
        serviceBean.setProtocol( dubboProtocolConfig );
        serviceBean.setApplication( applicationConfig );
        return serviceBean;
    }*/


}
